package domain.lexicalAnalyzerGenerator;

import java.util.List;

import domain.regularExpression.NonUnaryRegularExpressionOperator;

public class ChainCallInstruction extends Instruction {

	private List<Instruction> subInstructions;

	public ChainCallInstruction(NonUnaryRegularExpressionOperator  nonUnaryRegularExpressionOperator) 
	throws InstructionException {
		subInstructions = Instruction.getSubInstructions(nonUnaryRegularExpressionOperator);
	}

	public String generateCode() throws CodeGenerationException {
		String res = ""; 
		for (int i = 0; i < subInstructions.size(); i++){
			res += subInstructions.get(i).generateCode();
		}
		
		return res;
	}
}